package Class;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.junit.Test;



public class T1{
	
	private static final String String = null;
	private Connection conn=null;
	private Statement sm=null;

	
	@Test
	public void test(String name,String pwd,String tel,String email) throws ClassNotFoundException, SQLException{
		String url="jdbc:mysql://127.0.0.1:3306/wtf?"
				+ "useUnicode=true&amp;characterEncoding=utf-8";
		Class.forName("com.mysql.jdbc.Driver");
		conn=DriverManager.getConnection(url, "root","x5");
		sm=conn.createStatement();
//		String sql=" SELECT a.id,a.test "
//+" from test a";
		StringBuilder sb=new StringBuilder("INSERT INTO wtf_biao_denglu(`name`,`password`,tel,email)"+
			     "VALUES('"+name+"','"+pwd+"',"+tel+","+email+");");
		System.out.println("sql="+sb.toString());
        sm.executeUpdate(sb.toString());

		sm.close();
		conn.close();
	}
	
	
	

}
